import {
    createSlice
} from '@reduxjs/toolkit'
export const USER_KEY = 'user'
const {
    reducer: userReducer,
    actions
} = createSlice({
    name: USER_KEY,
    initialState: {
        user: null
    },
    reducers: {
        setUser(state, actions) {
            state.user = actions.payload
        }
    }
})


export const {
    setUser,
} = actions
export default userReducer